package com.first.common.pojo;


import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* 用户表
* @TableName acl_user
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@EqualsAndHashCode(callSuper = false)
@TableName("acl_user")
@ApiModel(value = "User对象",description = "用户表")
public class AclUser implements Serializable {

    /**
    * 会员id
    */

    @ApiModelProperty("会员id")
    private String id;
    /**
    * 用户名
    */

    @ApiModelProperty("用户名")
    private String username;
    /**
    * 密码
    */

    @ApiModelProperty("密码")
    private String password;
    /**
    * 备注
    */

    @ApiModelProperty("备注")
    private String nickName;
    /**
    * 盐
    */

    @ApiModelProperty("状态：0（启用）1：禁用")
    private Integer status;
    /**
    * 逻辑删除 1（true）已删除， 0（false）未删除
    */
    @ApiModelProperty("逻辑删除 1（true）已删除， 0（false）未删除")
    private Integer isDeleted;
    /**
    * 创建时间
    */

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;


    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;
    /**
     * 头像
     */
    @ApiModelProperty(value = "头像地址")
    private String headUrl;
}
